﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using MediaCentral.Services.DAL.Entities;
using System.ServiceModel.Web;

namespace MediaCentral.Services
{
    // TODO: Comment the shit out of this service
    [ServiceContract]
    public interface IMCService
    {
        [OperationContract]
        [WebInvoke( Method = "GET", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, UriTemplate = "/GetAllVideos")]
        List<Video> GetAllVideos();

        [OperationContract]
        [WebInvoke(Method = "GET", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, UriTemplate = "/GetAFewVideos?num={num}")]
        List<Video> GetNumberOfVideos(int num);

        [OperationContract]
        [WebInvoke(Method = "GET", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, UriTemplate = "/GetAllVideosByTag?tag={tag}")]
        List<Video> GetAllVideosByTag(string tag);

        [OperationContract]
        [WebInvoke(Method = "GET", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, UriTemplate = "/GetAllTags?")]
        string[] GetAllTags();

        [OperationContract]
        [WebInvoke(Method = "GET", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, UriTemplate = "/UpdateVideo?libName={libName}&id={id}&title={title}&description={description}&thumbnail={thumbnail}&tags={tags}")]
        bool UpdateVideo(string libName, int id, string title, string description, string thumbnail, string tags);

        [OperationContract]
        [WebInvoke(Method = "GET", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, UriTemplate = "/GetVideosBySearchString?q={query}")]
        List<Video> GetVideosBySearchString(string query);

        [OperationContract]
        [WebInvoke(Method = "GET", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, UriTemplate = "/AddNewVideo?listType={listType}&title={title}&description={description}&thumbnail={thumbnail}&videoid={videoid}&tags={tags}")]
        bool AddNewVideo(string listType, string title, string description, string thumbnail, string videoid, string tags);
    }
}
